<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>

<body>

<div id="app">
    <button v-on:click="sayHi">click Me</button>
</div>


<!--导入vue。js-->
<script>
  var vm = new Vue({
    el:"#app",
    data:{
        message:"asdasda"
    },
    methods:{//方法必须定义在Vue的Method对象中,v-on绑定事件
      sayHi:function (){
          alert(this.message);
      }
       }
  });

</script>
</body>
</html>